package ar.edu.unq.wannaplay.panels.client;

import org.apache.wicket.markup.html.navigation.paging.PagingNavigator;

import ar.edu.unq.wannaplay.panels.WPListViewPanel;
import ar.edu.unq.wannaplay.roles.AbstractLinkAdderStrategy;
import ar.edu.unq.wannaplay.services.ClientService;
import ar.edu.unq.wannaplay.utils.ClientListView;

public class ClientViewPanel extends WPListViewPanel<ClientService> {

    private static final long serialVersionUID = 1L;

    public ClientViewPanel(final String id, final ClientService service) {
        super(id, service, new String[] { "name", "email" });
        this.initialize();
    }

    private void initialize() {
        AbstractLinkAdderStrategy.getUserLoged().addClientCreateLinks(this);
        this.add(this.prepareHeaderLabel("headers"));
        ClientListView listView = new ClientListView("populatedList", this.getService(), this.getLabels(), this);
        this.add(listView);
        this.add(new PagingNavigator("navigator", listView));
    }
}
